<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of clusterMontage</title>
  <meta name="keywords" content="clusterMontage">
  <meta name="description" content="Used for visualization of clusters of images and videos.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html images -->
<h1>clusterMontage
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Used for visualization of clusters of images and videos.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function IC = clusterMontage( I, IDX, nElem, pad ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Used for visualization of clusters of images and videos.

 Organizes the matrix I, which is either MxNxR for images or MxNxTxR for
 videos, into a [M x N x T x nElem x nCluster] array IC, where each
 element IC(:,:,:,:,i) is the set of objects belonging to cluster i.
 If not all clusters have the same size, if pad==1 blank elements are
 added to pad the clusters so they do in fact have the same size, and if
 pad is 0 then IC is a cell vector where IC{i} is the set of objects
 belonging to cluster i.

 To display only a subset of clusters, given in a vector cs, use IDXb:
  IDXb = zeros(size(IDX)); for i=1:length(cs) IDXb(IDX==cs(i))=i; end;

 USAGE
  IC = clusterMontage( I, IDX, nElem, [pad] )

 INPUTS
  I       - MxNxR array of images or MxNxTxR array of videos
  IDX     - cluster membership (Rx1 integer vector) [see kmeans2.m]
  nElem   - max number of instances to show of each cluster
  pad     - [1] pads each cluster w blanks so it has exactly nElem

 OUTPUTS
  IC      - if pad==1  [M x N x T x nElem x nCluster] array
          - if pad==0  nCluster cell of [M x N x T x nElem_i] arrays

 EXAMPLE - images
  load( 'images.mat' );
  keep=randSample(144,80); IDXi=IDXi(keep); images=images(:,:,keep);
  IC = clusterMontage( images, IDXi, 9, 0 );
  figure(1); montage2( IC )

 EXAMPLE - videos
  load( 'images.mat' );
  IC = clusterMontage( videos, IDXv, 9, 0 );
  figure(1); playMovie( IC )

 See also KMEANS2, <a href="montage2.html" class="code" title="function varargout = montage2( IS, prm )">MONTAGE2</a>, <a href="playMovie.html" class="code" title="function M = playMovie( I, fps, loop, prm )">PLAYMOVIE</a>, CELL2ARRAY

 Piotr's Computer Vision Matlab Toolbox      Version 2.0
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
